package cn.wolfcode.wolf2w.util;

import cn.wolfcode.wolf2w.exception.LogicalException;
import org.springframework.util.StringUtils;

/**
 * 抽取工具类
 */
public abstract class AsserUtil {

    //抽取工具方法,判断参数是否为空
    public static void hasLength(String str, String msg) {
        if (!StringUtils.hasLength(str)) {
            throw new LogicalException(msg);
        }
    }

    public static void IsEquals(String str1,String str2){
        if (str1 == null || str2 == null){
            throw new LogicalException("输入的参数不能为空");
        }
        if (!str1.equals(str2)){
            throw new LogicalException("确认密码错误");
        }
    }
}
